/**
 * 
 */
package org.jboss.minstaller.util



/**
 * @author jjeon@redhat.com
 *
 */
public class SSHUtil {
    
    public static void sshCommand(serverIp, userId, passWord, sshCommand) {
        def ant = new AntBuilder() 
        ant.sshexec( username:userId, password: passWord, host: serverIp, command: sshCommand );
    }
    
    
    public static void sshCommandInDir(serverIp, userId, passWord, dir, sshCommand) {
        def ant = new AntBuilder() 
        ant.sshexec( username:userId, password: passWord, host: serverIp, command: "cd " + dir + "; "+ sshCommand );
    }
    
    static void main(args) {
        SSHUtil.sshCommandInDir( "localhost", "jboss", "jboss", "/home/jboss/documents", "ls");
    }
}
